Operating the Cash Drawer
.If not already in place, add a reference to:Ncr.As.Interfaces.DeviceManagerInterfaces.dll
using Ncr.Managers.DeviceManager;
// ask the device manager for the cashDrawer interface by name
ICashDrawerDevice cashDrawer = deviceManager.GetDevice("CashDrawer") as ICashDrawerDevice;
// or ask by device type
ICashDrawerDevice cashDrawer = deviceManager.GetDevice(typeof(ICashDrawerDevice)) as ICashDrawerDevice;
// open the drawer
cashDrawer.OpenDrawer();
// query for the drawer status to look for a close
bool isOpen = cashDrawer.DrawerOpen;
// or hook to the event signaling the drawer is closed
cashDrawer.DrawerClosed += cashDrawer_DrawerClosed;
void cashDrawer_DrawerClosed(ICashDrawerDevice obj)
{
// handle the drawer closing event.
}
// or use the termination key assigned to the cash drawer to prompt for input
// as done above.